package com.itheima.pinda.authority.config;

import com.itheima.pinda.authority.biz.service.common.OptLogService;
import com.itheima.pinda.log.event.SysLogListener;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;


/**
 * @description: 系统操作日志类
 * @author: admin
 * @time: 2022/10/17 14:51
 */
@Configuration
@EnableAsync
public class SysLogConfiguration {

    //创建日志记录的监听器
    @Bean
    public SysLogListener sysLogListener(OptLogService optLogService){
       return new SysLogListener(optLogService::save);
    }
}
